package com.lct.demo;

public class Test5 {
    public static void main(String[] args) {
        /**
         * 请把一个整数数组拷贝成一个一模一样的出来
         */
        int[]  arr = {11, 22, 33};
        System.out.print("[");
        for (int i = 0; i < arr.length; i++) {
            System.out.print(i == arr.length - 1 ? copyArr(arr)[i] : copyArr(arr)[i] + ",");
        }
        System.out.println("]");
    }
    public static int[] copyArr(int[] arr){
        int[] result = new int[arr.length];
        for (int i = 0; i < arr.length; i++) {
            result[i] = arr[i];
        }
        return result;
    }
}
